package com.qf.rbac2202.sys.controller;


import com.qf.rbac2202.sys.entity.SysUser;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;

/**
 * Controller层公用父类
 */
public abstract class AbstractController {

    /**
     * 获取当前登录用户
     * @return
     */
    protected SysUser getCurrentUser(){

        final Subject subject = SecurityUtils.getSubject();

        final SysUser sysUser = (SysUser) subject.getPrincipal();

        return sysUser;

    }

}
